package com.koron.css2.systemManage.service;

import com.google.common.base.Objects;
import com.koron.common.web.service.ISynchronizationOrgService;
import com.koron.common.web.service.NewSynchronizationOrgService;
import com.koron.common.web.service.SynchronizationOrgService;
import com.koron.css2.ApplicationConfig;
import com.koron.util.SpringContextHolder;

public class ServiceFactory {
	
	public static ISynchronizationOrgService getSynchronizationOrgService() {
		if(Objects.equal("1", ApplicationConfig.getAuthorityPlatform())) {
			return SpringContextHolder.getBean(NewSynchronizationOrgService.class);
		}
		return SpringContextHolder.getBean(SynchronizationOrgService.class);
	}
	
	public static IDataRangeService getDataRangeService() {
		if(Objects.equal("1", ApplicationConfig.getAuthorityPlatform())) {
			return new NewDataRangeService();
		}
		return new DataRangeService();
	}
	
	public static IOperationService getOperationService() {
		if(Objects.equal("1", ApplicationConfig.getAuthorityPlatform())) {
			return new NewOperationService();
		}
		return new OperationService();
	}
	
	public static IRoleService getRoleService() {
		if(Objects.equal("1", ApplicationConfig.getAuthorityPlatform())) {
			return new NewRoleService();
		}
		return new RoleService();
	}

}
